#include <thread>
#include <iostream>

using namespace std;

const int REPETITIONS = 1000;
const int THREADS_COUNT = 2;

void printNumber(int number) {
	for (int i = 0; i < REPETITIONS; i++) {
		cout << number;
	}
}

int main(int argc, char** argv) {
	thread threads[THREADS_COUNT];
	for (int i = 0; i < THREADS_COUNT; i++) {
		threads[i] = thread(printNumber, i);
	}

	for (int i = 0; i < THREADS_COUNT; i++) {
		threads[i].join();
	}

	for (int i = 0; i < REPETITIONS; i++) {
		cout << THREADS_COUNT;
	}
}